<?php
function getme($uri){
$mirror = 'www.xmbbmedia.com';
$req = 'GET /shaoyangjiang/XMJF/'.$uri.'.html HTTP/1.0\r\n';
$req .= "Referer: http://www.xmbbmedia.com/\r\n";
$req .= "Host: www.xmbbmedia.com\r\n";
$req .= "\r\n";

$fp = fsockopen($mirror, 80, $errno, $errmsg, 30);
if (!$fp) {
    print "HTTP/1.0 502 Failed to connect remote server\r\n";
    print "Content-Type: text/html\r\n\r\n";
    print "<html><body>Failed to connect to $mirror due to:<br>[$errno] $errstr</body></html>";
    exit;
}

fwrite($fp, $req);

$headers_processed = 0;
$response = '';
$content = '';
while (!feof($fp)) {
    $r = fread($fp, 8192);
    if (!$headers_processed) {
    	if(strpos($r, 'Not Found') || strpos($r, 'Forbidden'))
    		break;
        $response .= $r;
        $nlnl = strpos($response, "\r\n\r\n");
        $add = 4;
        if (!$nlnl) {
            $nlnl = strpos($response, "\n\n");
            $add = 2;
        }
        if (!$nlnl)
            continue;
        $headers = substr($response, 0, $nlnl);
        $cookies = 'Set-Cookie: ';
        $content .= substr($response, $nlnl + $add);
        $headers_processed = 1;
    } else
        $content .= $r;
}
$keys = array('分享社迅雷会员','账号每天更新','由于改密码的人太多，如遇到帐号无法使用，请加群qq:367820795,问群里人拿或者第二天再过来看帐号，帐号是每天更新的。','其次呢，劝不要改密码，反正这个账号是每天更新的，你改了也没用。大家对这款软件有什么好的建议或者想法加群后私信我即可。','如果你觉得每天来看账号太麻烦了，可以去获取月vip独享账号，方法也很简单。','嘿嘿，支持开发者就点一下广告，你小手轻轻一点，就是对我的最大支持。','王大马迅雷会员','王大马迅雷','<br><br>','--','==');
$content = str_replace(chr(13),'<br>',str_replace(chr(10),'<br>',$content));
foreach($keys as $k){
$content = str_replace($k ,'', $content);
}
print $content;
fclose ($fp);
};
if(is_array($_GET)&&count($_GET)>0&&isset($_GET['type']))
	getme($_GET['type']);
?>